﻿using AutoMapper;
using Entity.BaseInfo.DTO;
using Entity.BaseInfo.DTO.Customer;
using Entity.BaseInfo.DTO.Department;
using Entity.BaseInfo.DTO.Goods;
using Entity.BaseInfo.DTO.LogisticsCompany;
using Entity.BaseInfo.DTO.Staff;
using Entity.BaseInfo.DTO.Supplier;
using Entity.BaseInfo.DTO.Warehouse;
using Entity.BaseInfo.DTO.WarehousePosition;
using Entity.BaseInfo.Entity;
using Entity.ERP.DTO.PurchaseArriveOrder;
using Entity.ERP.DTO.PurchaseOrder;
using Entity.ERP.DTO.SaleDeliveryOrder;
using Entity.ERP.DTO.SaleOrder;
using Entity.ERP.Entity;
using Entity.Finance.DTO.DailyReimburse;
using Entity.Finance.DTO.IncomeAccount;
using Entity.Finance.DTO.IncomeAccountItem;
using Entity.Finance.DTO.PayAccount;
using Entity.Finance.DTO.PayAccountItem;
using Entity.Finance.Entity;
using Entity.System.DTO.CodeRule;
using Entity.System.DTO.Menu;
using Entity.System.Entity;
using Entity.WMS.DTO.WarehouseOtherIn;
using Entity.WMS.DTO.WarehouseOtherOut;
using Entity.WMS.DTO.WarehouseStocktaking;
using Entity.WMS.Entity;
using Entity.WMS.View.WarehouseOtherOut;
using Entity.WMS.View.WarehouseStocktaking;

namespace FrameWork.Config
{
    public class MappingProfile : Profile
    {
        public MappingProfile()
        {
            /**
             * 系统
             */
            //菜单管理
            CreateMap<MenuAddDTO, MenuModel>();
            CreateMap<MenuUpdateDTO, MenuModel>();
            //编码管理
            CreateMap<CodeRuleAddDTO, CodeRuleModel>();
            CreateMap<CodeRuleUpdateDTO, CodeRuleModel>();

            /**
             * 基础信息
             */
            //部门管理
            CreateMap<DepartmentAddDTO, DepartmentModel>();
            CreateMap<DepartmentUpdateDTO, DepartmentModel>();
            //人员管理
            CreateMap<StaffAddDTO, StaffModel>();
            CreateMap<StaffUpdateDTO, StaffModel>();
            //客户管理
            CreateMap<CustomerAddDTO, CustomerModel>();
            CreateMap<CustomerUpdateDTO, CustomerModel>();
            //物料管理
            CreateMap<GoodsAddDTO, GoodsModel>();
            CreateMap<GoodsUpdateDTO, GoodsModel>();
            //供应商管理
            CreateMap<SupplierAddDTO, SupplierModel>();
            CreateMap<SupplierUpdateDTO, SupplierModel>();
            //仓库管理
            CreateMap<WarehouseAddDTO, WarehouseModel>();
            CreateMap<WarehouseUpdateDTO, WarehouseModel>();
            //仓位管理
            CreateMap<WarehousePositionAddDTO, WarehousePositionModel>();
            CreateMap<WarehousePositionUpdateDTO, WarehousePositionModel>();
            //物流公司
            CreateMap<LogisticsCompanyAddDTO, LogisticsCompanyModel>();
            CreateMap<LogisticsCompanyUpdateDTO, LogisticsCompanyModel>();

            /**
             * WMS
             */
            //其他入库
            CreateMap<WarehouseOtherInAddDTO, WarehouseOtherInModel>();
            CreateMap<WarehouseOtherInItemAddDTO, WarehouseOtherInItemModel>();

            //其他出库
            CreateMap<WarehouseOtherOutAddDTO, WarehouseOtherOutModel>();
            CreateMap<WarehouseOtherOutItemAddDTO, WarehouseOtherOutItemModel>();

            //仓库盘点
            CreateMap<WarehouseStocktakingAddDTO, WarehouseStocktakingModel>();
            CreateMap<WarehouseStocktakingItemAddDTO, WarehouseStocktakingItemModel>();

            //仓库库存
            CreateMap<WarehouseOtherInItemModel, WarehouseInventoryModel>();
            CreateMap<WarehouseOtherOutItemModel, WarehouseInventoryModel>();
            CreateMap<WarehouseStocktakingItemModel, WarehouseInventoryModel>();

            //库存结存
            CreateMap<WarehouseOtherInItemModel, WarehouseBalanceModel>();
            CreateMap<WarehouseOtherInItemModel, WarehouseBalanceItemModel>();
            CreateMap<WarehouseOtherOutItemView, WarehouseBalanceModel>();
            CreateMap<WarehouseOtherOutItemView, WarehouseBalanceItemModel>();
            CreateMap<WarehouseStocktakingItemView, WarehouseBalanceModel>();
            CreateMap<WarehouseStocktakingItemView, WarehouseBalanceItemModel>();

            /**
             * ERP
             */
            //销售订单
            CreateMap<SaleOrderAddDTO, SaleOrderModel>();
            CreateMap<SaleOrderItemAddDTO, SaleOrderItemModel>();
            CreateMap<SaleOrderUpdateDTO, SaleOrderModel>();
            CreateMap<SaleOrderItemUpdateDTO, SaleOrderItemModel>();

            //销售发货单
            CreateMap<SaleDeliveryAddDTO, SaleDeliveryModel>();
            CreateMap<SaleDeliveryItemAddDTO, SaleDeliveryItemModel>();
            CreateMap<SaleDeliveryUpdateDTO, SaleDeliveryModel>();
            CreateMap<SaleDeliveryItemUpdateDTO, SaleDeliveryItemModel>();

            //采购订单
            CreateMap<PurchaseOrderAddDTO, PurchaseOrderModel>();
            CreateMap<PurchaseOrderItemAddDTO, PurchaseOrderItemModel>();
            CreateMap<PurchaseOrderUpdateDTO, PurchaseOrderModel>();
            CreateMap<PurchaseOrderItemUpdateDTO, PurchaseOrderItemModel>();

            //采购到货单
            CreateMap<PurchaseArriveOrderAddDTO, PurchaseArriveOrderModel>();
            CreateMap<PurchaseArriveOrderItemAddDTO, PurchaseArriveOrderItemModel>();
            CreateMap<PurchaseOrderUpdateDTO, PurchaseArriveOrderModel>();
            CreateMap<PurchaseArriveItemUpdateDTO, PurchaseArriveOrderItemModel>();

            /**
             * Finance
             */
            //日常报销单
            CreateMap<DailyReimburseAddDTO, DailyReimburseModel>();
            CreateMap<DailyReimburseUpdateDTO, DailyReimburseModel>();

            //报销审批单
            CreateMap<DailyReimburseModel, ExamineReimburseModel>();
            CreateMap<DailyReimburseUpdateDTO,ExamineReimburseModel>();

            //应收对账单
            CreateMap<IncomeAccountAddDTO, IncomeAccountModel>();
            CreateMap<IncomeAccountItemSearchDTO,IncomeAccountItemModel>();

            //应付对账单
            CreateMap<PayAccountAddDTO, PayAccountModel>();
            CreateMap<PayAccountItemAddDTO, PayAccountItemModel>();
        }
    }
}
